<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //条件判断
    let xhs = 5,xg = 1;
    if (xg>0){
        xhs = 1;
    }
    console.log(xhs);
    /*
    if(条件表达式){
        条件为真
    }else{
        条件不为真
    }*/
   //两个值找最大值
   let num1 = 100,num2 = 300,max;
   if(num1>num2){
        max = num1;
   }else{
        max = num2;
   }
   console.log('最大值是：'+max);
   console.log('-----------------');
  /* if(num1>num2){
        max = num1;
   }else if(num2>num1){
        max = num2;
   }else{
    console.log('num1=num2')
   }*/
   let a = prompt();
   let b = prompt();
   let min;
   if(a>b){
    min = b;
   }else if(a<b){
    min = a;
   }else{
    console.log('a和b相等');
   }
   console.log('最小值是：'+min);
</script>
</html>